<?php
use yii\widgets\ActiveForm;
?>
<link rel="stylesheet" href="../static/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../static/jBox/Skins/Metro/jbox.css" type="text/css">
<link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css" type="text/css">
<link rel="stylesheet" href="../static/css/admin.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/treeTable/jquery.treetable.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/treeTable/jquery.treetable.theme.default.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/datatables/jquery.dataTables.css" type="text/css">
<link rel="stylesheet" href="../static/app/goods-keyword/css/bootstrap.min.css" type="text/css" >
<link rel="stylesheet" href="../static/app/goods-keyword/css/jquery.dropdown.css" type="text/css" >
<style>
.ul_tree_display {
	display: none;
}

.tr_tree_display {
	display: none;
}

.table>tbody>tr>td {
	vertical-align: middle;
	font-size: 0.8em;
}

.layui-layer-content p {
	padding: 15px;
}

.dataTables_length {
	margin-top: 10px;
}
</style>
<div class="tabs-panel">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<div class="box-header">
					<button type="button" class="btn btn-success depart-modal category-show-btn add-hot-sale" style="width: 100px;">添加</button>
				</div>
				<div class="box-body">
					<table id="tableid" class="table table-bordered table-hover">
						<thead>
							<tr>
								<th class="">操作</th>
								<th class="">ID</th>
								<th class="">名称</th>
								<th class="">排序</th>
								<th class="">备注</th>
								<th class="">平台</th>
								<th class=""><?=TITLE_STATUS?></th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="modal fade" id="hot-sale-modal" style="background: rgba(236, 230, 230, 0.3);" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 70%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">添加热销商品</h4>
            </div>
            <div class="modal-body">
                <form action="/goods-hot-sale/change-hot-sale" method="post" name="hot_sale_form" id="hot_sale_form">
                    <div class="box-body">
                    	<div class="form-group">
                            <label for="tag_group_id_add"><span class="text-danger" style="font-size:20px;">* </span>平台</label>
                            <select name="platform" id="platform" style="width: 25%;"  class="form-control">
                            	<option value="1">pc</option>
                            	<option value="2">wap</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="tag_group_id_add"><span class="text-danger" style="font-size:20px;">* </span>名称</label>
                            <input style="width: 50%;" class="form-control" name="hot_sale_name" id="hot_sale_name" placeholder="热销组名称" type="text">
                        </div>
                        <div class="form-group">
                            <label for="tag_group_id_add"><span class="text-danger" style="font-size:20px;">* </span>排序</label>
                            <input style="width: 50%;" class="form-control" name="sort" id="sort" placeholder="热销组排序" type="text">
                        </div>
                        <div class="form-group">
                            <label for="tag_group_id_add">备注</label>
                            <textarea style="width: 50%;"  class="form-control" name="memo" placeholder="热销组备注" id="memo"></textarea>
                        </div>
                        <div class="form-group">
                            <label for="tag_group_id_add"><span class="text-danger" style="font-size:20px;">* </span>状态</label>
                            <select name="use_flg" id="use_flg" style="width: 25%;"  class="form-control">
                            	<option value="1">启用</option>
                            	<option value="0">禁用</option>
                            </select>
                        </div>
                        <input name="hot_sale_id" type="hidden" id="hot_sale_id">
                        <div class="form-group type_pc">
                            <button type="button" class="btn btn-success depart-modal" id="add_input" style="width: 100px;">添加图片</button>
                            <table class="table table-hover" id="input_table">
                            	<thead>
                                    <tr>
                                    	<th width="20%"><span class="text-danger" style="font-size:20px;">* </span>选择商品</th>
                                        <th width="25%">图片title</th>
                                        <th width="25%">图片alt</th>
                                        <th width="10%"><span class="text-danger" style="font-size:20px;">* </span>图片</th>
                                        <th width="10%">查看图片</th>
                                        <th width="15%">操作</th>
                                    </tr>
                                </thead>
                                <tbody class="tbody-class">
                                </tbody>
                            </table>
                        </div>
                        <div class="type_wap hide">
                        	<label for="tag_group_id_add"><span class="text-danger" style="font-size:20px;">* </span>首页限时抢GO商品</label>
                            <div class="form-group">
                            	<table class="table table-hover" id="input_table_sku_go">
                                	<thead>
                                        <tr>
                                            <th>物料号</th>
                                            <th>商品名称</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody class="tbody-class">
                                    </tbody>
                                </table>
                            </div>
                            
                        	<label for="tag_group_id_add"><span class="text-danger" style="font-size:20px;">* </span>限时抢GO商品列表</label>
                            <div class="form-group">
                            	<button type="button" class="btn btn-success depart-modal" id="add_input_category" style="width: 100px;">添加分类</button>
                                <table class="table table-hover" id="input_table_category">
                                	<thead>
                                        <tr>
                                            <th>分类名称</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody class="tbody-class">
                                    </tbody>
                                </table>
                            </div>
                            <div class="form-group">
                            	<button type="button" class="btn btn-success depart-modal" id="add_input_sku" style="width: 100px;">添加商品</button>
                            	&nbsp;&nbsp;&nbsp;<a style="text-decoration:underline;" href="../static/app/goods-hot-sale/限时抢GO商品导入.xls">模板下载</a>
                            	&nbsp;&nbsp;&nbsp;<a style="text-decoration:underline;" href="javascript:void(0)" class="upload-img-btn">excel导入</a>
                                <table class="table table-hover" id="input_table_sku">
                                	<thead>
                                        <tr>
                                            <th>物料号</th>
                                            <th>商品名称</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody class="tbody-class">
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </form>
                <div style="display: none">
                    <form id="upload_form_update_excel" action="/goods-hot-sale/excel-file-upload" method="post" enctype="multipart/form-data">
                    	<label for="file">Filename:</label>
                    	<input type="file" name="file" id="file" class="upload_file"/> 
                    	<br />
                    	<input type="submit" name="submit" value="Submit" />
                    </form>
                </div>
                <div style="display: none">
                    <?php $form = ActiveForm::begin(['id'=>'upload_form_update','action'=>'/common/img-upload'],['options' => ['enctype' => 'multipart/form-data']]) ?>
                    <?= $form->field($model, 'img_url')->fileInput(['class' => 'upload_file_ot']) ?>
                    <?php ActiveForm::end() ?>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <a type="button" class="btn btn-primary ajax_post_tag">提交</a>
            </div>
        </div>
    </div>
</div>
<input name="class_len" id="class_len" value="0" type="hidden"/>
<input type="hidden" id="check_img_val">
<input type="hidden" name="imageBathUrl" id="imageBathUrl" value="<?php echo Yii::$app->params['imageBathUrl'] . '/' ?>">
<!-- 固定js -->
<script type="text/javascript" src="/static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/plugins/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="/static/jBox/jquery.jBox-2.3.min.js"></script>
<script type="text/javascript" src="/static/jBox/i18n/jquery.jBox-zh-CN.js"></script>
<script type="text/javascript" src="/static/plugins/treeTable/jquery.treetable.js"></script>
<!-- 搜索下拉框插件 -->
<script type="text/javascript" src="../static/app/goods-keyword/js/jquery.dropdown.js"></script>
<script type="text/javascript" src="../static/app/goods-keyword/js/mock.js"></script>
<!-- 文件上传插件 -->
<script type="text/javascript" src="../static/app/goods-hot-sale/ajaxfileupload.js"></script>
<!--图片上传插件用-->
<script type="text/javascript" src="/static/plugins/jquery.form.js"></script>
<!--图片显示用-->
<script type="text/javascript" src="/static/plugins/layer/layer.js"></script>
<!-- 自定义js -->
<script type="text/javascript" src="/static/app/global.js?version=<?=Yii::$app->params['version']?>"></script>
<script type="text/javascript" src="/static/app/goods-hot-sale/list.js?version=<?=Yii::$app->params['version']?>"></script>
<script>
var sale_edit = <?=(is_array($sale_edit) ? json_encode($sale_edit) : '')?>;
var category = <?=(is_array($GLOBALS['_GOODS_GENRE_TYPE']) && count($GLOBALS['_GOODS_GENRE_TYPE']) > 0 ? json_encode($GLOBALS['_GOODS_GENRE_TYPE']) : '')?>;
</script>